package com.help10000.rms.ui.utils

import org.greenrobot.eventbus.EventBus

class EventBusHelper {
    companion object {

        fun register(obj: Any) {
            if (!EventBus.getDefault().isRegistered(obj))
                EventBus.getDefault().register(obj)
        }

        fun unRegister(obj: Any) {
            if (EventBus.getDefault().isRegistered(obj))
                EventBus.getDefault().unregister(obj)
        }

        fun post(obj: Any) {
            EventBus.getDefault().post(obj)
        }

        fun postSticky(obj: Any) {
            EventBus.getDefault().postSticky(obj)
        }
    }
}